/*
 * constraint.hpp
 *
 *  Created on: 24/11/2011
 *      Author: Aeradon
 */

#ifndef CONSTRAINT_HPP_
#define CONSTRAINT_HPP_

#include <list>
#include "point.hpp"

class SymEdge;
class Vertex;
class Face;
class Edge;

class Constraint
{
public:
	Constraint(unsigned int id, float x1, float y1, float x2, float y2);
	virtual ~Constraint();

	inline void setEndVertices(Vertex* v1, Vertex* v2) { this->v1 = v1; this->v2 = v2; };

	void addSymEdge(SymEdge* e);
	void removeSymEdge(SymEdge* e);

public:
	unsigned int vecIndex;

	unsigned int id;

	Point<float> p1, p2;

	// Access the starting and final vertices of the constraint.
	// there may be more vertices between them.
	Vertex* v1, *v2;

private:
	// Stores all the SymEdges that compose this Constraint
	std::list<SymEdge*> l_symEdge;
};

#endif /* CONSTRAINT_HPP_ */
